package n17.first;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.stream.Stream;

public class F02 {

	public static void main(String[] args) {
		Path path = Paths.get("D:\\Root");
		
		try (Stream<Path> stream=Files.walk(path)) {
			stream.sorted(Comparator.reverseOrder())
				.map(Path::toFile)
				.forEach(f->f.delete());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
